package main;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.GameCanvas;
/**
 * @author Toshiba
 */
public class MainMidlet extends MIDlet {
    private PlayingCanvas gameCanvas;
    private MainMenuScreen MainMenu;
    private StoryModeMenuScreen storyModeMenu;
    private StoryModeMenuOptionScreen storyModeMenuOption;
    public void startApp() {
//        this.gameCanvas = new PlayingCanvas(this);
//        gameCanvas.start();
        MainMenu = new MainMenuScreen(this);
        MainMenu.start();
        showScreen(MainMenu);
    }
    
    public void showScreen(Displayable d)
    {
        Display.getDisplay(this).setCurrent(d);
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }
    
    public void exit()
    {
        notifyDestroyed();
    }
    
    public void showStoryModeMenu()
    {
        if(storyModeMenu == null)
            storyModeMenu = new StoryModeMenuScreen(this);
        storyModeMenu.start();
        showScreen(storyModeMenu);
    }
    public void showHealPokemonScreen(Character character, Item item)
    {
        HealPokemonScreen healPokemonScreen = new HealPokemonScreen(this, item, character);
        healPokemonScreen.start();
        showScreen(healPokemonScreen);
    }
    public void showStoryModeMenuOption(Item item, Character character)
    {
        if(storyModeMenuOption == null)
            storyModeMenuOption = new StoryModeMenuOptionScreen(this, item, character);
        storyModeMenuOption.start();
        showScreen(storyModeMenuOption);
    }
    public void showAboutScreen()
    {
        AboutScreen aboutScreen = new AboutScreen(this);
        aboutScreen.start();
        showScreen(aboutScreen);
    }
    
    public void showMainMenu()
    {
        if(MainMenu == null)
            MainMenu = new MainMenuScreen(this);
        MainMenu.start();
        showScreen(MainMenu);
    }
    
    public void showPlayingCanvas(Character character, Pokemon pokemon2, Item item, boolean isFreeBattle)
    {

        if(gameCanvas == null)
            gameCanvas = new PlayingCanvas(this, character, pokemon2, item, isFreeBattle);
        gameCanvas.start();
        showScreen(gameCanvas);
    }
}

